!function(a) {
    function c(c, d, e) {
        var h, j, f = this, g = a(this), i = c.length - 1;
        a.each(e, function(b, c) {
            a.isFunction(c) && g.bind(b, c);
        }), a.extend(this, {
            click: function(d, i) {
                var j = c.eq(d);
                return "string" == typeof d && d.replace("#", "") && (j = c.filter("[href*=" + d.replace("#", "") + "]"), 
                d = Math.max(j.index(), 0)), i = i || a.Event(), i.type = "beforeSwitch", g.trigger(i, [ d ]), 
                i.isDefaultPrevented() || (b[e.effect].call(f, d, function() {
                    i.type = "onSwitch", g.trigger(i, [ d ]);
                }), i.type = "onStart", g.trigger(i, [ d ]), i.isDefaultPrevented()) ? void 0 : (h = d, 
                c.removeClass(e.currentCls), j.addClass(e.currentCls), f);
            },
            getCfg: function() {
                return e;
            },
            getTriggers: function() {
                return c;
            },
            getPanels: function() {
                return d;
            },
            getVisiblePanel: function(a) {
                return f.getPanels().slice(a * e.steps, (a + 1) * e.steps);
            },
            getIndex: function() {
                return h;
            },
            move: function(a) {
                return d.parent().is(":animated") || d.length <= e.visible ? f : "number" == typeof a ? 0 > a ? e.circular ? f.click(i) : f : a > i ? e.circular ? f.click(0) : f : f.click(a) : f.click();
            },
            next: function() {
                return f.move(h + 1);
            },
            prev: function() {
                return f.move(h - 1);
            },
            bind: function(a, b) {
                return g.bind(a, b), f;
            },
            unbind: function(a) {
                return g.unbind(a), f;
            },
            beforeSwitch: function(a) {
                return this.bind("beforeSwitch", a);
            },
            onSwitch: function(a) {
                return this.bind("onSwitch", a);
            },
            resetPosition: function() {}
        }), c.each(function(b) {
            "mouse" === e.triggerType ? a(this).bind({
                mouseenter: function(a) {
                    b !== h && (j = setTimeout(function() {
                        f.click(b, a);
                    }, 1e3 * e.delay));
                },
                mouseleave: function() {
                    clearTimeout(j);
                }
            }) : a(this).bind("click", function(a) {
                return b !== h && f.click(b, a), !1;
            });
        }), location.hash ? f.click(location.hash) : (0 === e.initIndex || e.initIndex > 0) && f.click(e.initIndex), 
        d.find("a[href^=#]").click(function(b) {
            f.click(a(this).attr("href"), b);
        }), e.panelSwitch && d.css("cursor", "pointer").click(function() {
            return f.next(), !1;
        });
    }
    a.switchable = a.switchable || {}, a.switchable = {
        cfg: {
            triggers: "a",
            currentCls: "current",
            initIndex: 0,
            triggerType: "mouse",
            delay: .1,
            effect: "default",
            steps: 1,
            visible: 1,
            speed: .7,
            easing: "swing",
            circular: !1,
            vertical: !1,
            panelSwitch: !1,
            beforeSwitch: null,
            onSwitch: null,
            api: !1
        },
        addEffect: function(a, c) {
            b[a] = c;
        }
    };
    var b = {
        "default": function(a, b) {
            this.getPanels().hide(), this.getVisiblePanel(a).show(), b.call();
        },
        ajax: function(a, b) {
            this.getPanels().first().load(this.getTriggers().eq(a).attr("href"), b);
        },
        iframe: function(a) {
            this.getPanels().first().find("iframe").attr("src", this.getTriggers().eq(a).attr("href"));
        }
    };
    a.fn.switchable = function(b, d) {
        var f, g, e = this.eq("number" == typeof d ? d : 0).data("switchable");
        return e ? e : (a.isFunction(d) && (d = {
            beforeSwitch: d
        }), f = a.extend({}, a.switchable.cfg), g = this.length, d = a.extend(f, d), this.each(function(f) {
            var j, k, h = a(this), i = b.jquery ? b : h.children(b);
            if (i.length || (i = 1 == g ? a(b) : h.parent().find(b)), j = h.find(d.triggers), 
            !j.length) {
                for (k = Math.ceil(i.length / d.steps), f = 1; k >= f; f++) a("<a>", {
                    href: "javascript:void(0);",
                    target: "_self",
                    text: f
                }).appendTo(h);
                j = h.children("a");
            }
            e = new c(j, i, d), h.data("switchable", e);
        }), d.api ? e : this);
    };
}(jQuery), function(a) {
    function c(b) {
        switch (b.type) {
          case "mousemove":
            return a.extend(b.data, {
                clientX: b.clientX,
                clientY: b.clientY,
                pageX: b.pageX,
                pageY: b.pageY
            });

          case "DOMMouseScroll":
            a.extend(b, b.data), b.delta = -b.detail / 3;
            break;

          case "mousewheel":
            b.delta = b.wheelDelta / 120;
        }
        return b.type = "wheel", a.event.handle.call(this, b, b.delta);
    }
    a.fn.wheel = function(a) {
        return this[a ? "bind" : "trigger"]("wheel", a);
    }, a.event.special.wheel = {
        setup: function() {
            a.event.add(this, b, c, {});
        },
        teardown: function() {
            a.event.remove(this, b, c);
        }
    };
    var b = a.browser.mozilla ? "DOMMouseScroll" + (a.browser.version < "1.9" ? " mousemove" : "") : "mousewheel";
    a.fn.mousewheel = function() {
        return this.each(function() {
            var b = a(this).switchable();
            b.getPanels().parent().wheel(function(a, c) {
                return 0 > c ? b.next() : b.prev(), !1;
            });
        }), this;
    };
}(jQuery);